import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import UserList from '../views/user/UserList.vue'
import RoleList from "../views/user/RoleList.vue";
import menus from '../views/menu/menus.vue'
import Index from "../views/Index";
import Wzjbxx from "../views/cms/Wzjbxx";
import Gggl from "../views/cms/Gggl";
import Mbgl from "../views/cms/Mbgl";
import Ymgl from "../views/cms/Ymgl";
import Borrowuser from "../views/borrowing/Borrowuser";
import Investment from "../views/investment/Investment";
import addLoan from '../views/borrowing/addLoan';
import Biaoup from '../views/mark/Biaoup';
import borrowcheck from '../views/borrowing/borrowcheck';
import addbiao from '../views/borrowing/addbiao'
import Maintain from "../views/borrowing/Maintain";
import updateLoan from "../views/borrowing/updateLoan";
import LookDetail from "../views/mark/LookDetail";
import UpdateDetail from "../views/mark/UpdateDetail";
import Recharge from "../views/record/recharge";
import tixianList from "../views/record/tixianList";
import Biaocheck from '../views/borrowing/Biaocheck'
import TouziDetail from "../views/touzi/TouziDetail";
import Repayback from "../views/repayment/Repayback";
import Repaybackplan from '../views/repayment/Repaybackplan'
import Shenhe from "../views/borrowing/Shenhe";
Vue.use(VueRouter)

const routes = [
  {path:"/",redirect:"/login"},
  {name:'登录',path:'/login',component:Login},
  {name:'主页',path:'/home',component:Home,children:[
      {name:'首页',path:'/index',component:Index},
      {name:'用户管理',path:'/userlist',component:UserList},
      {name:'角色管理',path: '/rolelist',component: RoleList},
      {name:'菜单管理',path: '/menus',component: menus},
      {name:'网站基本信息',path: '/wzjbxx',component: Wzjbxx},
      {name:'广告管理',path: '/gggl',component: Gggl},
      {name:'模板管理',path: '/mbgl',component: Mbgl},
      {name:'页面管理',path: '/ymgl',component: Ymgl},
      {name:'借款人管理',path: '/borrowuser',component: Borrowuser},
      {name:'投资人管理',path: '/investuser',component: Investment},
      {name:'新增借贷',path: '/addborrow',component: addLoan},
      {name:'新增借贷',path: '/biaoup',component: Biaoup},
      {name:'借款审核',path: '/borrowcheck',component: borrowcheck},
      {name:'添加标的信息',path: '/addbiao',component: addbiao},
      {name:'新标维护',path: '/maintain',component: Maintain},
      {name:'修改借款信息',path: '/updateloan',component: updateLoan},
      {name:'充值记录',path: '/chong',component: Recharge},
      { name: "查询表数据",path: '/tolookbiao',component: LookDetail },
      {name: "修改表信息",path: '/updatebid',component: UpdateDetail},
      {name: "提现列表",path: '/ti',component: tixianList},
      {name:"投资详情",path: '/invest',component: TouziDetail},
      {name:"投资详情",path: '/biaocheck',component: Biaocheck},
      {name:"还款管理",path: '/payback',component: Repayback},
      {name:"还款计划",path: '/repaybackplan',component: Repaybackplan},
      {name:"借款审核",path: '/shenhe',component: Shenhe},
    ]},
]

const router = new VueRouter({
  routes
})
/*router.beforeEach(function (to,from,next) {
    if(to.path=="/login"){
      return next();
    }
    let user=sessionStorage.getItem("user");
    if(user){
      return next();
    }
    next("/login");
})*/

export default router
